# app/role/serializers.py
from rest_framework import serializers
from .models import McRole


class McRoleSerializer(serializers.ModelSerializer):
    class Meta:
        model = McRole
        fields = ["id", "role", "created_time", "updated_time"]


class McForeignRoleSerializer(serializers.ModelSerializer):
    """用于外键嵌套的轻量版，仅返回必要字段"""
    class Meta:
        model = McRole
        fields = ["id", "role"]
